// 用户相关数据
const state = {
    token: '',
    name: '',
    // 菜单
    menu: [
        {
            name: "index",
            title: "网站首页",
            path: "/index",
            icon: "el-icon-s-home",
            children: []
        },
        {
            name: "system",
            title: "系统管理",
            path: "/system",
            icon: "el-icon-s-tools",
            children: [
                {
                    name: "users",
                    title: "人员管理",
                    path: "users",
                    children: []
                },
                {
                    name: "roles",
                    title: "角色管理",
                    path: "roles",
                    children: []
                },
                {
                    name: "menus",
                    title: "菜单管理",
                    path: "menus",
                    children: []
                }
            ]
        },
        {
            name: "nest",
            title: "嵌套页面",
            path: "/nest",
            icon: "el-icon-s-comment",
            children: [
                {
                    name: "nestChild1",
                    title: "二级页面1",
                    path: "nest-child1",
                    children: [
                        {
                            name: "nestItem",
                            title: "三级页面1",
                            path: "nest-item",
                            children: []
                        }
                    ]
                },
                {
                    name: "nestChild2",
                    title: "二级页面2",
                    path: "nest-child2",
                    children: []
                }
            ]
        },
        {
            name: "gitee",
            title: "Gitee码云",
            path: "https://gitee.com",
            icon: "el-icon-share",
            children: []
        }
    ]
}

const mutations = {
    SET_TOKEN: (state, token) => {
        state.token = token;
    },
    SET_NAME: (state, name) => {
        state.name = name
    },
    SET_MENU: (state, menu) => {
        state.menu = menu;
    }
}
const actions = {}
export default {
    namespaced: true,
    state,
    mutations,
    actions
}